\ This code is similar to .IVARS above, since we find the superclasses by traversing the ivar chain to find the n-way for the supers. But of course we don't print any ivar information.
^class ifa displace -> thisivar
begin
thisivar @ 0>
if \ Traverse n-way for superclasses
begin thisivar @ 0exit
thisivar @absM -> ^cl
cri ." superclass "
^cl .id
^cl ['] object =
nif 2 ++> cl_depth
^cl recurse
2 --> cl_depth
then
4 ++> thisivar
again
else \ Ordinary ivar
thisivar 8 + @absM -> ^cl
thisivar 4+ displace -> thisivar
then
again ;
' null vect VV
local .WHATEVER { cfa \ ^obj svModbase -- b }
: .OBJECT
cfa ?typ 2 spaces
modbase -> svModbase set_modbase
cfa >obj -> ^obj \ Note: we've altered modbase, but
print: ^obj \ it's OK here since none of these
^obj dup >class \ words are local to this module.
svModbase -> modbase
0 -> cl_depth
.ivlist ;
: .CLASS
." Class " cfa dup .id .supers ;
: .DEFN ;
: .VALUE cfa ?typ ;
: .VECT
." Vect -> "
4 ++> cfa \ Step past JSR doVect
cfa @ nif
4 ++> cfa ." default: "
location cfa -> location identify? drop -> location
else cfa @abs .id
then ;
:loc .WHATEVER \ { cfa -- b }
cfa 2- w@x
case[ objcode ]=> .object false
[ classcode ]=> .class false
[ ' .inst 2 - w@x ]=> .defn true
[ ' location 2 - w@x ]=> .value false
[ ' vv 2 - w@x ]=> .vect false
default=> ." ???" drop false
]case
;loc
: START { cfa \ ok? -- ok? } \ Sets things up for a new decompilation.
\ Returns true if we are to continue.
true -> ok?
cfa -> location
\ location locate_src
2 ++> gin din
." : " cfa dup .id >name c@ 64 and if ." IMMEDIATE" then